<{include file="public_html/header.html"}>
<{include file="public_html/left_menu.html"}>
<style>
	.layui-table img{max-height: 100px;}
</style>
	<!-- content starts -->
	<blockquote class="layui-elem-quote"><{$action}></blockquote>

	<fieldset class="layui-elem-field">
  		<legend>按条件搜索</legend>
  		<div class="layui-field-box">
			<form class="layui-form layui-form-pane1" method="post" action="<{$current_url}>">
				<div class="layui-form-item">
					<div class="layui-inline">
			    		<select name="subject_id">
			    		<option value="0">请选择科目</option>
			    		<option value="33">数学</option>
			    		<option value="34">语文</option>
			    		<option value="35">英语</option>
			    		</select>	
			    	</div>
			    	<div class="layui-inline">
			    		<select name="book_id">
			    		<option value="0">请选择课本</option>
			    		
			    		</select>	
			    	</div>
			    	<div class="layui-inline">
			    		<input type="text" name="text" placeholder="题目内容" value="<{if $text}><{$text}><{/if}>" class="layui-input">
			    	</div>
			    	<div class="layui-inline">
			    		<button type="submit" class="layui-btn">搜索</button>
			    		<a class="layui-btn" href="/topic/add"><i class="layui-icon"></i> 添加题目</a>
			    		<a class="layui-btn" href="/topic_tiankong/add"><i class="layui-icon"></i> 添加填空题</a>
			    		<a class="layui-btn" href="/topic_calc/add"><i class="layui-icon"></i> 添加计算题</a>
			    		<!-- <a class="layui-btn" href="/topic/add_blend"><i class="layui-icon"></i> 添加算式题</a> -->
			    		<!-- <a class="layui-btn" href="/topic/import"><i class="layui-icon"></i> 导入题目</a> -->
			    	</div>
		    	</div>

				
			</form>
  		</div>
	</fieldset>
	<form class="layui-form layui-form-pane1" method="post" delete_action="/topic/delete">
		<table class="layui-table" lay-even lay-skin="row">
		  	<thead>
			  	<tr>
				  	<th>ID</th>
				  	<th>题目内容</th>
				  	<th>题目类型</th>
				  	<th>科目</th>
				  	<th>课本</th>
				  	<th>创建时间</th>
				  	<th>是否有子题目</th>
				  	<th>操作</th>
			  	</tr>
		  	</thead>   
		  	<tbody>
		  	<{foreach from=$topic_list item=item}>
			  	<tr>
			  		<td class="center">
						<input type="checkbox" name="ids[]" value="<{$item['id']}>" title="<{$item['id']}>">
			  		</td>
			  		<td class="center"><{$item['subject_text']}></td>
			  		<td class="center"><{if $item['type'] == 1}>单选题<{elseif $item['type'] == 2}>多选题<{elseif $item['type'] == 3}>判断题<{elseif $item['type'] == 4}>简答题<{elseif $item['type'] == 5}>填空题<{elseif $item['type'] == 6}>计算题<{/if}></td>
			  		<td class="center">
			  			<{$item['subject_name']}>
			  		</td>
			  		<td class="center">
			  			<{$item['book_name']}>
			  		</td>
			  		<td class="center"><{$item['add_time']|date_format:'%Y-%m-%d %H:%M:%S'}></td>
			  		<td class="center"><{if $item['has_sub_topic'] == 1}>是<{else}>否<{/if}></td>
			  		<td class="center">
			  			<a class="layui-btn layui-btn-primary layui-btn-small" href="http://wap.youhaoke.vip/my/tiku/start_topic_test/<{$item.chapter_id}>/<{$item['id']}>" target="_blank">预览</a>
			  			<{if $item['has_sub_topic'] == 1}>
			  				<a class="layui-btn layui-btn-primary layui-btn-small" href="/topic/save_topic_item/<{$item['id']}>"><i class="layui-icon">&#xe608;</i> 添加子题目</a>
			  				<a class="layui-btn layui-btn-primary layui-btn-small" href="/topic/show_items/<{$item['id']}>"><i class="layui-icon">&#xe62d;</i>   子题目列表</a>
			  			<{else}>
			  				<a class="layui-btn layui-btn-primary layui-btn-small" href="/topic/save_topic_item/<{$item['id']}>"><i class="layui-icon">&#xe608;</i> 添加答案</a>
			  			<{/if}>
						<a class="layui-btn layui-btn-primary layui-btn-small" href="/topic/edit/<{$item['id']}>" target="_blank"><i class="layui-icon"></i></a>
						<a class="layui-btn layui-btn-primary layui-btn-small delete_data" href="/topic/delete/<{$item['id']}>"><i class="layui-icon"></i></a>
					</td>
			  	</tr>
		  	<{/foreach}>
		  	<{if $topic_list|count eq 0}>
		  		<tr>
			  		<td class="center" style=" height:120px; text-align:center;line-height:120px;" colspan="8">
						赞无数据！
					</td>
			  	</tr>
		  	<{/if}>
		  	<tr>
				<td class="center" colspan="8">
					<input type="checkbox" lay-filter="checkbox_all" title="全选">
					<button id="delete" class="layui-btn layui-btn-primary layui-btn-small" style="margin-top:4px;"><i class="layui-icon"></i> 批量删除</button>
				</td>
			</tr>
	  		</tbody>
	  	</table>
  	</form>
  	<div class="layui-box layui-laypage layui-laypage-default">
		<{$pagination}>
	</div>      
<{include file="public_html/footer.html"}>